<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">

	<ui:composition template="/templates/baseLayout.xhtml">
		<ui:define name="pageTitle">Upload Photos</ui:define>
		<ui:define name="messagesBox">
			<h:messages infoClass="msginfo" warnClass="msgwarn" errorClass="msgerror" 
						showSummary="true" style="list-style: none;"/>
		</ui:define>
		<ui:define name="pageBody">
			<h:panelGrid id="FileUploadGrid">
				<h:form>			
					<rich:fileUpload id="UploadImages" fileUploadListener="#{orderAction.fileUploadListener}" 
						maxFilesQuantity="10" acceptedTypes="jpg, jpeg, gif, png" addLabel="Browse Photos" listHeight="1"
						noDuplicate="true" uploadLabel="Upload Photos" >
						<a4j:ajax event="uploadcomplete" listener="#{orderAction.prepareOrder}" render="FileUploadGrid" />				
					</rich:fileUpload>
				</h:form>			
	            <ui:include src="/pages/photos/previewPhotos.xhtml" />	        						
	    	</h:panelGrid>	    	    
    	</ui:define>		
	</ui:composition>
</html>						